(#) androidx.fragment:fragment

Name
:   fragment
Description
:   The Support Library is a static library that you can add to your Android
:   application in order to use APIs that are either not available for older
:   platform versions or utility APIs that aren't a part of the framework
:   APIs. Compatible on devices running API 14 or later.
License
:   [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)
Vendor
:   Android Open Source Project
Identifier
:   androidx.fragment
Feedback
:   https://issuetracker.google.com/issues/new?component=460964
Min
:   Lint 7.0
Compiled
:   Lint 8.0 and 8.1
Artifact
:   androidx.fragment:fragment:1.8.5

(##) Included Issues

|Issue Id                                                                  |Issue Description                                                                                                       |
|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
|[FragmentTagUsage](FragmentTagUsage.md.html)                              |Use FragmentContainerView instead of the <fragment> tag                                                                 |
|[FragmentAddMenuProvider](FragmentAddMenuProvider.md.html)                |Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance                                        |
|[FragmentBackPressedCallback](FragmentBackPressedCallback.md.html)        |Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance                                        |
|[FragmentLiveDataObserve](FragmentLiveDataObserve.md.html)                |Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object       |
|[UseRequireInsteadOfGet](UseRequireInsteadOfGet.md.html)                  |Use the 'require_____()' API rather than 'get____()' API for more descriptive error messages when it's null             |
|[UseGetLayoutInflater](UseGetLayoutInflater.md.html)                      |Use getLayoutInflater() to get the LayoutInflater instead of calling LayoutInflater.from(Context)                       |
|[DialogFragmentCallbacksDetector](DialogFragmentCallbacksDetector.md.html)|Use onCancel() and onDismiss() instead of calling setOnCancelListener() and setOnDismissListener() from onCreateDialog()|
|[UnsafeRepeatOnLifecycleDetector](UnsafeRepeatOnLifecycleDetector.md.html)|RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments                                                   |
|[DetachAndAttachSameFragment](DetachAndAttachSameFragment.md.html)        |Separate attach() and detach() into separate FragmentTransactions                                                       |

(##) Including

!!!
   This is not a built-in check. To include it, add the below dependency
   to your project.

```
// build.gradle.kts
implementation("androidx.fragment:fragment:1.8.5")

// build.gradle
implementation 'androidx.fragment:fragment:1.8.5'

// build.gradle.kts with version catalogs:
implementation(libs.fragment)

# libs.versions.toml
[versions]
fragment = "1.8.5"
[libraries]
# For clarity and text wrapping purposes the following declaration is
# shown split up across lines, but in TOML it needs to be on a single
# line (see https://github.com/toml-lang/toml/issues/516) so adjust
# when pasting into libs.versions.toml:
fragment = {
    module = "androidx.fragment:fragment",
    version.ref = "fragment"
}
```

1.8.5 is the version this documentation was generated from;
there may be newer versions available.

(##) Changes

* 1.2.0: First version includes FragmentLiveDataObserve,
  FragmentTagUsage.
* 1.2.2: Adds FragmentBackPressedCallback, UseRequireInsteadOfGet.
* 1.4.0: Adds DetachAndAttachSameFragment,
  DialogFragmentCallbacksDetector, FragmentAddMenuProvider,
  UnsafeRepeatOnLifecycleDetector, UseGetLayoutInflater.

(##) Version Compatibility

There are multiple older versions available of this library:

| Version            | Date     | Issues | Compatible | Compiled      | Requires |
|-------------------:|----------|-------:|------------|--------------:|---------:|
|               1.8.5|2024/10/30|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.8.4|2024/10/02|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.8.3|2024/09/04|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.8.2|2024/07/24|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.8.1|2024/06/26|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.8.0|2024/06/12|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.7.1|2024/05/14|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.7.0|2024/05/01|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.6.2|2023/11/01|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.6.1|2023/07/26|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.6.0|2023/06/07|       9|         Yes|    8.0 and 8.1|8.0 and 8.1|
|               1.5.7|2023/04/19|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.6|2023/03/22|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.5|2022/12/07|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.4|2022/10/24|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.3|2022/09/21|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.2|2022/08/10|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.1|2022/07/27|       9|         Yes|    7.3 and 7.4|       7.0|
|               1.5.0|2022/06/29|       9|      No[^1]|    7.3 and 7.4|       7.0|
|               1.4.1|2022/01/26|       9|      No[^1]|            7.1|       7.1|
|               1.4.0|2021/11/17|       9|      No[^1]|            7.1|       7.1|
|               1.3.6|2021/07/21|       4|         Yes|            4.1|       3.3|
|               1.3.5|2021/06/16|       4|         Yes|            4.1|       3.3|
|               1.3.4|2021/05/18|       4|         Yes|            4.1|       3.3|
|               1.3.3|2021/04/21|       4|         Yes|            4.1|       3.3|
|               1.3.2|2021/03/24|       4|         Yes|            4.1|       3.3|
|               1.3.1|2021/03/10|       4|         Yes|            4.1|       3.3|
|               1.3.0|2021/02/10|       4|         Yes|            4.1|       3.3|
|               1.2.5|2020/06/10|       4|         Yes|            3.6|       3.3|
|               1.2.4|2020/04/01|       4|         Yes|            3.6|       3.3|
|               1.2.3|2020/03/18|       4|         Yes|            3.6|       3.3|
|               1.2.2|2020/02/19|       4|         Yes|            3.6|       3.3|
|               1.2.1|2020/02/05|       2|         Yes|            3.6|       3.3|
|               1.2.0|2020/01/22|       2|         Yes|            3.6|       3.3|

Compatibility Problems:

[^1]: org.jetbrains.uast.kotlin.KotlinUClass#getKtClass(): org.jetbrains.kotlin.psi.KtClassOrObject is not accessible  

<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://morgan3d.github.io/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>